<template>
	<view class="cardstyle">
		<text class="titlebox">{{title}}</text>
		<view class="tipsbox">
			<text style="color: #f00;" v-if="isTop">置顶</text>
			<text>{{author}}</text>
			<text>{{comments}}评</text>
			<view style="flex:1; display: flex; justify-content: flex-end;">
				<text>{{time}}</text>
			</view>
		</view>
		<slot name="tips"></slot>
	</view>
</template>

<script>
	export default {
		name: "cardViewText",
		data() {
			return {
				title: "乘势而上，续写中国奇迹新篇章--党的二十届四中全会侧记",
				isTop: true,
				author: "新华社",
				comments: 56,
				time: "2025.10.28"
			};
		},
		props: {
			title: {
				type: String,
				default: "新闻标题",
				require: true
			},
			isTop: {
				type: Boolean,
				default: false,
				require: true
			},
			author: {
				type: String,
				default: "来源",
				require: true
			},
			comments: {
				type: Number,
				default: 0,
				require: true
			},
			time: {
				type: String,
				default: "2025.1.1"
			}
		},
		methods: {

		}
	}
</script>

<style>
	.cardstyle {
		padding: 15px;
		background-color: #ffffff;
		border-radius: 8px;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
		margin: 10px;
	}

	/* 标题样式 */
	.titlebox {
		font-size: 18px;
		font-weight: bold;
		color: #333;
		line-height: 1.4;
		display: block;
		margin-bottom: 12px;
	}

	.tipsbox {
		display: flex;
		align-items: center;
		font-size: 12px;
		color: #666;
		gap: 10px;
	}
</style>